//
//  RBSecondKillTimeCell.m
//  zhongzhenglu
//
//  Created by 马军凯 on 2023/4/28.
//

#import "RBSecondKillTimeCell.h"

@interface RBSecondKillTimeCell ()
//时间
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
//状态
@property (weak, nonatomic) IBOutlet UIButton *statusBtn;

@end

@implementation RBSecondKillTimeCell

- (void)awakeFromNib {
    [super awakeFromNib];
}
//赋值
- (void)setModel:(RBSecondKillTimesModel *)model {
    _model = model;
    //时间
    self.timeLabel.text = model.interval_name;
    //状态
    NSString *state = @"";
    if (model.isCurrent == YES) {
        state = @"抢购中";
    } else {
        state = @"即将开始";
    }
    [self.statusBtn setTitle:state forState:UIControlStateNormal];
    //
    if ([model.is_kill isEqualToString:@"1"]) {
        self.timeLabel.textColor = [UIColor LC_hex:@"#E83922"];
        [self.statusBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self.statusBtn LC_cornerRadius:10];
        self.statusBtn.backgroundColor = [UIColor LC_hex:@"#E83922"];
    } else {
        self.timeLabel.textColor = [UIColor LC_hex:@"#333333"];
        [self.statusBtn setTitleColor:[UIColor LC_hex:@"#999999"] forState:UIControlStateNormal];
        [self.statusBtn LC_cornerRadius:0];
        self.statusBtn.backgroundColor = [UIColor clearColor];
    }
}

@end
